<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script>
$(document).ready(function(){
		$('#chrcount').keyup(function(){
			var len = $('#chrcount').val();
			var char = len.length;	
			if(254-char == 0){
				}
			$('#chrcountlength').html(255-char);	
		});
	});
	
	$(document).ready(function(){
		$('#chrcount2').keyup(function(){
			var len = $('#chrcount2').val();
			var char = len.length;	
			if(254-char == 0){
				}
			$('#chrcountlength2').html(255-char);	
		});
	});
</script>

<div id="mws-container" class="clearfix">
<div class="container">
  <div class="mws-panel grid_8">
    <div class="mws-panel-header"> <span class="mws-i-24 i-list">Add Option</span> </div>
    <div class="mws-panel-body">
      <div class="mws-form-inline"> 
	  <?php echo $form->create(array('controller'=>'setups','action'=>'','method'=>'post','class' => 'mws-form')); ?>
       <?php 
		if(isset($details['Option']['id'])){$details['Option']['id']=$details['Option']['id'];}else{$details['Option']['id']="";}
	     echo $this->Form->input('Option.id', array('type' => 'hidden','value'=>$details['Option']['id']));?>
        <div class="mws-form-row">
          <label>* Title :</label>
          <div class="mws-form-item small"> <?php 
		  if(isset($details['Option']['name'])){$details['Option']['name']=$details['Option']['name'];}else{$details['Option']['name']="";}
		  echo $this->Form->input('Option.name', array('type' => 'text','value'=>$details['Option']['name'],'class'=>'mws-textinput','label' =>false));?> </div>
        </div>
        <div class="mws-form-row">
          <label>Option Type :</label>
          <div class="mws-form-item small">
            <select name="data[Option][type]" id="OptionType">
	  <?php 
            if(isset($details['Option']['type']) and ($details['Option']['type']))
                {
                    echo ' <option class= "selected" selected ="selected" value="'.$details['Option']['type'].'">'.$details['Option']['type'].'</option>';
                }
        ?>
              <optgroup label="Choose">
              <option value="select">Select</option>
              <option value="radio">Radio</option>
              <option value="checkbox">Checkbox</option>
              <option value="image">Image</option>
              </optgroup>
              <optgroup label="Input">
              <option value="text">Text</option>
              <option value="textarea">Textarea</option>
              </optgroup>
              <optgroup label="File">
              <option value="file">File</option>
              </optgroup>
              <optgroup label="Date">
              <option value="date">Date</option>
              <option value="time">Time</option>
              <option value="datetime">Date &amp; Time</option>
              </optgroup>
            </select>
          </div>
        </div>
        <div class="mws-form-row">
          <label>Sort Type :</label>
          <div class="mws-form-item 	small">
<?php 		 
		if(isset($details['Option']['sort'])){$details['Option']['sort']=$details['Option']['sort'];}else{$details['Option']['sort']="";}
		echo $this->Form->input('Option.sort', array('type' => 'text','value'=>$details['Option']['sort'],'class'=>'mws-textinput','label' =>false));?> 
        </div>
        </div>
        <div class="mws-form-row">
          <label>Status Type :</label>
          <div class="mws-form-item 	small">
            <?php 
		     	if(isset($details['Option']['status'])){$details['Option']['status']=$details['Option']['status'];}else{$details['Option']['status']="";}
				$options = array('1'=>'Active', '0'=>'Deactive'); 
					echo $this->Form->input('Option.status', 
					array('type' => 'select','options'=>$options,
					'default'=>$details['Option']['status'],'class'=>'mws-textinput','empty'=>false,'label' =>false)
				);
			?>
          </div>
        </div>
        <div class="mws-button-row">
          <input type="submit" class="mws-button black" value="Submit">
        </div>
        </form>
      </div>
    </div>
  </div>
</div>
s